package app.beans;

/**
 * Class representing a user.
 * @author Sweetie
 */
public class User 
{
    // Attribute login of the user.
    private final String LOGIN;
    // Attribute password of the user.
    private String password;
    
    /**
     * Class constructor.
     * @param login
     * @param password
     * @throws Exception 
     */
    public User(String login, String password) throws Exception
    {
        
        if(!"".equals(login) && !"".equals(password))
        {
            LOGIN = login;
            this.password = password;
        }
        else
        {
            throw new Exception("Senha e/ou Login não podem ser nulos.");
        }
    }

    /**
     * Method that returns the login. 
     * @return the login
     */
    public String getLogin() 
    {
        return LOGIN;
    }

    /**
     * Method that returns the password.
     * @return the password
     */
    public String getpassword() 
    {
        return password;
    }

    /**
     * Method that changes the password.
     * @param password the password to set
     */
    public void setPassword(String password) 
    {
        this.password = password;
    }
}
